package com.micro.modual.extension;

import com.micro.common.MicroConstant;
import com.micro.common.biz.GeneratorCodeUtil;
import com.micro.common.util.SnowFlakeUtil;
import com.micro.modual.entity.HotSearch;
import com.micro.modual.model.bo.hotsearch.HotSearchBO;

/**
 * <h1>热搜记录表(选用) 延展类</h1>
 *
 * @author LevelCoder
 * @version V1.0.0
 * @email LevelCoder@126.com
 * @date 2020-08-04 00:23:27
 */
public class HotSearchExtension {

    /**
     * <h2>转换: 热搜记录表(选用) 新增</h2>
     *
     * @param hotSearchBO {@link HotSearchBO} 热搜记录表(选用) 新增/修改 请求对象
     * @return {@link HotSearch} 热搜记录表(选用)
     */
    public static HotSearch converAddHotSearch(HotSearchBO hotSearchBO) {
        HotSearch hotSearch = new HotSearch();
        hotSearch.setId(SnowFlakeUtil.getId());
        hotSearch.setSearchKey(hotSearchBO.getSearchKey());
        hotSearch.setCreateTime(hotSearchBO.getCreateTime());
        hotSearch.setUpdateTime(hotSearchBO.getUpdateTime());
        hotSearch.setSearchCount(hotSearchBO.getSearchCount());
        return hotSearch;
    }

    /**
     * <h2>转换: 热搜记录表(选用) 修改</h2>
     *
     * @param hotSearchBO {@link HotSearchBO} 热搜记录表(选用) 新增/修改 请求对象
     * @return {@link HotSearch} 热搜记录表(选用)
     */
    public static HotSearch converEditHotSearch(HotSearchBO hotSearchBO) {
        HotSearch hotSearch = new HotSearch();
        hotSearch.setId(hotSearchBO.getId());
        hotSearch.setSearchKey(hotSearchBO.getSearchKey());
        hotSearch.setCreateTime(hotSearchBO.getCreateTime());
        hotSearch.setUpdateTime(hotSearchBO.getUpdateTime());
        hotSearch.setSearchCount(hotSearchBO.getSearchCount());
        return hotSearch;
    }
}
